<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wwwApp: SimpleTemplate Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">wwwApp
   </div>
   <div id="projectbrief">A web app for workshop organizing, recruitment and qualification</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">SimpleTemplate Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for SimpleTemplate:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classSimpleTemplate.png" usemap="#SimpleTemplate_map" alt=""/>
  <map id="SimpleTemplate_map" name="SimpleTemplate_map">
<area href="classPage.html" alt="Page" shape="rect" coords="0,56,99,80"/>
</map>
 </div></div>

<p><a href="classSimpleTemplate-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:acffbdf4be6884118b65718b1555426c3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#acffbdf4be6884118b65718b1555426c3">__construct</a> ($templateVariables=array())</td></tr>
<tr class="memitem:a8c01456f9f64a6d7ffbc063d92bdeba8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#a8c01456f9f64a6d7ffbc063d92bdeba8">__isset</a> ($name)</td></tr>
<tr class="memitem:a14a3c11b8ad27d5c4fe55fbcfff34a59"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#a14a3c11b8ad27d5c4fe55fbcfff34a59">__get</a> ($name)</td></tr>
<tr class="memitem:a315306e0336632452c4c468d8e7dadd1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#a315306e0336632452c4c468d8e7dadd1">__set</a> ($name, $value)</td></tr>
<tr class="memitem:a5873db512f6a24abafa6287b6deede66"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#a5873db512f6a24abafa6287b6deede66">finish</a> ($translate=false)</td></tr>
<tr class="memitem:aaf625b4472f09ef069a94fa91c05c154"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#aaf625b4472f09ef069a94fa91c05c154">__destruct</a> ()</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a957d26c00def511d906a47caa8bd83c0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#a957d26c00def511d906a47caa8bd83c0">$variables</a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a73cdbb48f8fe7aff6800c2c6f3a9f1ac"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleTemplate.html#a73cdbb48f8fe7aff6800c2c6f3a9f1ac">$cleaned</a> = false</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="template_8php_source.html#l00036">36</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="acffbdf4be6884118b65718b1555426c3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::__construct </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$templateVariables</em> = <code>array()</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00041">41</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">        {</div>
<div class="line">                $this-&gt;variables = $templateVariables;</div>
<div class="line">                ob_start();</div>
<div class="line">        }</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aaf625b4472f09ef069a94fa91c05c154"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::__destruct </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00103">103</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">        {</div>
<div class="line">                <span class="keywordflow">if</span> (!$this-&gt;cleaned &amp;&amp; ob_get_level())  ob_end_clean();</div>
<div class="line">        }</div>
</div><!-- fragment -->
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a14a3c11b8ad27d5c4fe55fbcfff34a59"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::__get </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00052">52</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">        {</div>
<div class="line">                <span class="keywordflow">if</span> (!array_key_exists($name, $this-&gt;variables))</div>
<div class="line">                        $this-&gt;variables[$name] = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">                <span class="keywordflow">return</span> $this-&gt;variables[$name];</div>
<div class="line">        }</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a8c01456f9f64a6d7ffbc063d92bdeba8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::__isset </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00047">47</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">        {</div>
<div class="line">                <span class="keywordflow">return</span> array_key_exists($name, $this-&gt;variables);</div>
<div class="line">        }</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a315306e0336632452c4c468d8e7dadd1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::__set </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00059">59</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">        {</div>
<div class="line">                $this-&gt;variables[$name] = $value;</div>
<div class="line">        }</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a5873db512f6a24abafa6287b6deede66"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::finish </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$translate</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reimplemented in <a class="el" href="classPage.html#a1960af93d393797b21b8b895f2fb3ff1">Page</a>.</p>

<p>Definition at line <a class="el" href="template_8php_source.html#l00064">64</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>
<div class="fragment"><div class="line">        {</div>
<div class="line">                <span class="keywordflow">if</span> ($this-&gt;cleaned)  <span class="keywordflow">return</span> <span class="stringliteral">&#39;Parser error - already flushed.&#39;</span>;</div>
<div class="line"></div>
<div class="line">                $names = array();</div>
<div class="line">                $values = array();</div>
<div class="line">                <span class="keywordflow">foreach</span> ($this-&gt;variables as $name =&gt; $value)</div>
<div class="line">                        <span class="keywordflow">if</span> (!is_array($value))</div>
<div class="line">                {</div>
<div class="line">                        $names[]= <span class="stringliteral">&quot;%$name%&quot;</span>;</div>
<div class="line">                        $values[]= $value;</div>
<div class="line">                }</div>
<div class="line"></div>
<div class="line">                $this-&gt;cleaned = <span class="keyword">true</span>;</div>
<div class="line">                $s = ob_get_clean();</div>
<div class="line">                <span class="keywordflow">if</span> ($translate)</div>
<div class="line">                {</div>
<div class="line">                        $result = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line">                        $length = strlen($s);</div>
<div class="line">                        $offset = 0;</div>
<div class="line">                        <span class="keywordflow">while</span> (($p = strpos($s, <span class="stringliteral">&#39;{{&#39;</span>, $offset)) !== <span class="keyword">false</span>)</div>
<div class="line">                        {</div>
<div class="line">                                $result .= substr($s, $offset, $p - $offset);</div>
<div class="line">                                $offset = strpos($s, <span class="stringliteral">&#39;}}&#39;</span>, $p);</div>
<div class="line">                                <span class="keywordflow">if</span> ($offset === <span class="keyword">false</span>)</div>
<div class="line">                                        <span class="keywordflow">return</span> <span class="stringliteral">&#39;Parser error - unfinished translate string.&#39;</span>;</div>
<div class="line">                                $result .= gettext(substr($s, $p + 2, $offset - $p - 2));</div>
<div class="line">                                $offset += 2;</div>
<div class="line">                                <span class="keywordflow">if</span> ($offset &gt; $length)</div>
<div class="line">                                        <span class="keywordflow">break</span>; <span class="comment">// strpos would issue a warning otherwise.</span></div>
<div class="line">                        }</div>
<div class="line">                        $result .= substr($s, $offset);</div>
<div class="line">                }</div>
<div class="line">                <span class="keywordflow">else</span></div>
<div class="line">                        $result = $s;</div>
<div class="line"></div>
<div class="line">                <span class="keywordflow">return</span> str_replace($names, $values, $result);</div>
<div class="line">        }</div>
</div><!-- fragment -->
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a73cdbb48f8fe7aff6800c2c6f3a9f1ac"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::$cleaned = false</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00039">39</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

</div>
</div>
<a class="anchor" id="a957d26c00def511d906a47caa8bd83c0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SimpleTemplate::$variables</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="template_8php_source.html#l00038">38</a> of file <a class="el" href="template_8php_source.html">template.php</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="template_8php_source.html">template.php</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Sep 8 2013 17:44:57 for wwwApp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
